﻿using Lufei_CaterDAL;
using Lufei_CaterModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lufei_CaterBLL
{
    public class OrderInfoBLL
    {

        OrderInfoDAL dal=new OrderInfoDAL();

        /// <summary>
        /// 插入订单信息
        /// </summary>
        /// <param name="oi"></param>
        /// <returns></returns>
        public int InsertOrderInfo(OrderInfo oi)
        {
          return  dal.InsertOrderInfo(oi);
        }

        /// <summary>
        /// 根据桌子id查询订单id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int GetOrderIDByDeskId(int id)
        {
            return dal.GetOrderIDByDeskId(id);
        }

        /// <summary>
        /// 获取钱
        /// </summary>
        /// <param name="orderid"></param>
        /// <returns></returns>
        public decimal GetMoney(int orderid)
        {

            return dal.GetMoney(orderid);
        }

        /// <summary>
        /// 更新金额
        /// </summary>
        /// <param name="orderID"></param>
        /// <param name="orderMoney"></param>
        /// <returns></returns>
        public bool UpdateMoney(int orderID, decimal orderMoney)
        {
            return dal.UpdateMoney(orderID, orderMoney) > 0;
        }


        /// <summary>
        /// 更新订单表数据
        /// </summary>
        /// <param name="oi"></param>
        /// <returns></returns>
        public bool UpdateOrderData(OrderInfo oi)
        {
            return dal.UpdateOrderData(oi) > 0;
        }
    }

}
